<template>
	<view>
		<Buy v-if="selected===0" :machineId="machine_id"></Buy>
		<My v-if="selected===1"></My>
		<view class="cu-bar tabbar bg-white shadow foot" style="height:110rpx;">
		    <view v-for="(item,index) in list" :key="index" @tap="selected=index" class="action" :class="selected === index?'text-red':'text-gray'">
		      <view :class="'cuIcon-'+(selected === index ? item.selectedIconPath : item.iconPath)" style="font-size:55rpx;">
		      </view>
		      <text class="text-df">{{item.text}}</text>
		    </view>
		</view>
	</view>
</template>

<script>
	import Buy from '@/components/vendingmachine/buy.vue';
	import My from '@/components/vendingmachine/my.vue';
	export default {
		components:{
			Buy,
			My
		},
		data() {
			return {
				machine_id:'',
				selected:0,
				list: [
					{
					"pagePath": "/pages/index/index",
					"iconPath": "home",
					"selectedIconPath": "homefill",
					"text": "首页"
					},
					{
					"pagePath": "/pages/my/my",
					"iconPath": "my",
					"selectedIconPath": "myfill",
					"text": "我的订单"
					}
				]
			};
		},
		onLoad(options) {
		    if(!options.machine_id){
				//options.machine_id='5f91b5182fb4776a34de76ac';
		    }
			this.machine_id=options.machine_id;
		},
		methods:{
			switchTab(){
				
			}
		}
	}
</script>

<style lang="scss">

</style>
